 #include<stdio.h>
 #include <sys/types.h>
 #include <time.h>
 #include<math.h>
 main()
 {
 	time_t t0,t1;
	long i;
	int a;
	double z,temp;
	
	//char Fun[1][10]={"sin","cos",};
 	printf("\n---------------For SIN function :");
	t0 = time(NULL);
	printf("\n Start time : %ld ", (long) t0);
	for( i=0 ; i < 50000000 ; i++)
		z = sin(45) ;
	t1 = time(NULL);
	printf("\n Finish time : %ld ", (long) t1);
	printf("\n time required for 50000000 iteration is : %ld sec",  (t1 - t0));
	printf("\n the value of sin(45) = %f",z);
	
	printf("\n---------------For COS function :");
	t0 = time(NULL);
	printf("\n Start time : %ld ", (long) t0);
	for( i=0 ; i < 50000000 ; i++)
		z = cos(45) ;
	t1 = time(NULL);
	printf("\n Finish time : %ld ", (long) t1);
	printf("\n time required for 50000000 iteration is : %ld sec",  (t1 - t0));
	printf("\n the value of cos(45) = %f",z);
	
	printf("\n---------------For log(45) function :");
	t0 = time(NULL);
	printf("\n Start time : %ld ", (long) t0);
	for( i=0 ; i < 50000000 ; i++)
		z = log(45) ;
	t1 = time(NULL);
	printf("\n Finish time : %ld ", (long) t1);
	printf("\n time required for 50000000 iteration is : %ld sec",  (t1 - t0));
	printf("\n the value of log(45) = %f",z);
	
	printf("\n---------------For e^(45) function :");
	t0 = time(NULL);
	printf("\n Start time : %ld ", (long) t0);
	for( i=0 ; i < 50000000 ; i++)
		z = exp(45) ;
	t1 = time(NULL);
	printf("\n Finish time : %ld ", (long) t1);
	printf("\n time required for 50000000 iteration is : %ld sec",  (t1 - t0));
	printf("\n the value of e^(45) = %f",z);
	
	printf("\n---------------For a^(45) function :");
	temp=45;
	printf("\n Please enter the value of a :");
	scanf("%d",&a);
	t0 = time(NULL);
	printf("\n Start time : %ld ", (long) t0);
	for( i=0 ; i < 50000000 ; i++)
		z = pow((double)a,temp) ;
	t1 = time(NULL);
	printf("\n Finish time : %ld ", (long) t1);
	printf("\n time required for 50000000 iteration is : %ld sec",  (t1 - t0));
	printf("\n the value of a^(45) ( where a=%d ) = %f",a,z);
	
	printf("\n---------------For 1+x  function where x=45 :");
	t0 = time(NULL);
	printf("\n Start time : %ld ", (long) t0);
	for( i=0 ; i < 50000000 ; i++)
		z = 1 + 45 ;
	t1 = time(NULL);
	printf("\n Finish time : %ld ", (long) t1);
	printf("\n time required for 50000000 iteration is : %ld sec",  (t1 - t0));
	printf("\n the value of 1+(45) = %f",z);
	
	printf("\n---------------For 1+x^2 function where x=45 :");
	t0 = time(NULL);
	printf("\n Start time : %ld ", (long) t0);
	for( i=0 ; i < 50000000 ; i++)
		z = 1+( temp * temp) ;
	t1 = time(NULL);
	printf("\n Finish time : %ld ", (long) t1);
	printf("\n time required for 50000000 iteration is : %ld sec",  (t1 - t0));
	printf("\n the value of 1+x^2 = %f",z);
	
	printf("\n---------------For sqrt(1+x^2) function where x=45 :");
	t0 = time(NULL);
	printf("\n Start time : %ld ", (long) t0);
	for( i=0 ; i < 50000000 ; i++)
		z = sqrt(1+( temp * temp)) ;
	t1 = time(NULL);
	printf("\n Finish time : %ld ", (long) t1);
	printf("\n time required for 50000000 iteration is : %ld sec",  (t1 - t0));
	printf("\n the value of sqrt(1+x^2) = %f",z);
	
	return 0;
 
 }
